﻿<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>绑定</title>
	<meta charset="utf-8" />
	<link href="../lib/highlight/default.css" rel="stylesheet" />
	<script src="../lib/jquery.js"></script>
	<script src="../lib/highlight.js"></script>
	<script src="../lib/jsm.js"></script>
	<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>


	<h1>jsm：</h1>
	<script>
var _ = jsm.model({Value:"这是初始值"});

//定义计数器
var count = 0;

jsm
	.input({type:"text",value:_`Value`})()
	.div`hello ${_`Value`} world`()
	.div({style:"background:yellow"})(_`Value`)()
	.input({type:"button",onclick:"_.Value = '计数器：' + (count++)",value:"增加计数器"})()
.render();
	</script>

<pre><code class="javascript">
var _ = jsm.model({Value:"这是初始值"});

//定义计数器
var count = 0;

jsm
	.input({type:"text",value:_`Value`})()
	.div`hello ${_`Value`} world`()
	.div({style:"background:yellow"})(_`Value`)()
	.input({type:"button",onclick:"_.Value = '计数器：' + (count++)",value:"增加计数器"})()
.render();
</code></pre>



</body>
</html>
